﻿
CREATE function [dbo].[fn_ReconPTSPearl]
(
	
)
RETURNS TABLE
AS
RETURN
(
	SELECT [Lob Parent] as LobParent, [System Goc Code] as Goc, [PTS Line] as PTSLine, SUM([YTD Amount]) as YTDAmount, [O&T Head] as OTHead
		FROM OPENQUERY (LACBRA800W0553,'DECLARE @date datetime 	SET @date = GetDate() 	EXEC PTS.dbo.sp_ReportReconPTSPearl 0, @date')
	WHERE [YTD Amount] <> 0
	GROUP BY [Lob Parent], [System Goc Code], [PTS Line], [O&T Head]
)